package be.sc.classicnetwork.service;

import java.util.Collection;

import be.sc.classicnetwork.dao.GenericDao;
import be.sc.classicnetwork.model.AbstractEntity;

/**
 * Generic service holding CRUD operations, each of these operations being
 * surronding by a transaction.
 */
public interface GenericService<T extends AbstractEntity> {
    /**
     * @see GenericDao#findById(int)
     */
    public T findById(String id);

    /**
     * @see GenericDao#findByIdFull(int)
     */
    public T findByIdFull(String id);

    /**
     * @see GenericDao#findAll(int, int)
     */
    public Collection<T> findAll(int first, int max);

    /**
     * @see GenericDao#saveOrUpdate(be.sc.classicnetwork.model.AbstractEntity)
     */
    public T saveOrUpdate(T entity);

    /**
     * @see GenericDao#delete(be.sc.classicnetwork.model.AbstractEntity)
     */
    public void delete(T entity);

    /**
     * @see GenericDao#deleteAll()
     */
    public void deleteAll();

    /**
     * @see GenericDao#countAll()
     */
    public int countAll();

}
